#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
    int count[26] = { 0 };
    int max = 0;
    char ch;
    while ((ch = getchar()) != '\0')
    {
        count[ch - 'a']++;
    }
    int i = 0;
    for (i = 1;i < 26; i++)
    {
        if (count[i] > count[max])
            max = i;
    }
    printf("%c\n%d", max + 'a', count[max]);
    return 0;
}